package com.tester.yaa.exam002.threadLocal;

/**
 * @Aduthor yinanan
 * @ClassName Test
 * @Date 2022/12/11 18:43
 * @Description 执行
 **/
public class Test {

    static Object object = new Object();//锁
    static boolean flag = true;//控制线程执行顺序
    static int num = 0;//包子数量

    public static void main(String[] args) {

        //初始化线程
        ProducerThread producer = new ProducerThread();
        ConsumerThread consumer = new ConsumerThread();

        //执行生产者
        Thread proThread = new Thread(producer, "我");
        proThread.start();

        //执行消费者
        Thread conThread = new Thread(consumer, "你");
        conThread.start();
    }
}
